package com.dyzx.hbb.modules.finance.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * 企业财务审批管理表
功能说明：
1. 记录企业财务审批信息
2. 包含审批基本信息、金额、消费类型等
3. 支持审批流程状态管理
4. 记录操作日志和审批记录
 * @TableName finance_organ_approval
 */
@TableName(value ="finance_organ_approval")
@Data
public class FinanceOrganApproval {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 金额(单位:分)
     */
    private Long amount;

    /**
     * No
     */
    private String no;

    /**
     * 审批备注信息
     */
    private String remark;
    /**
     * 凭证图片ID
     */
    private Long imageId;

    /**
     * 消费时间戳
     */
    private Long expandedDate;

    /**
     * 消费类型(1:交通,2:餐饮,3:住宿等)
     */
    private Long categoryId;

    /**
     * 收款方信息(包含收款人姓名/企业名称、账号、信用代码)
     */
    private String recipientInfo;

    /**
     * 创建日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createDate;

    /**
     * 更新日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateDate;

    /**
     * 删除标识(0:未删除,1:已删除)
     */
    private Integer deleted;

    /**
     * 审批状态(1:已通过,2:待审批,3:已拒绝)
     */
    private Integer status;

    /**
     * 销售员/申请人ID
     */
    private Long salesmanId;

    /**
     * 审批人用户ID
     */
    private Long approvedUserId;

    /**
     * 审批时间戳
     */
    private Long approvedDate;

    /**
     * 操作人ID
     */
    private Long operatorId;

    /**
     * 所属企业ID
     */
    private Long organId;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FinanceOrganApproval other = (FinanceOrganApproval) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getNo() == null ? other.getNo() == null : this.getNo().equals(other.getNo()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getImageId() == null ? other.getImageId() == null : this.getImageId().equals(other.getImageId()))
            && (this.getExpandedDate() == null ? other.getExpandedDate() == null : this.getExpandedDate().equals(other.getExpandedDate()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getRecipientInfo() == null ? other.getRecipientInfo() == null : this.getRecipientInfo().equals(other.getRecipientInfo()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getSalesmanId() == null ? other.getSalesmanId() == null : this.getSalesmanId().equals(other.getSalesmanId()))
            && (this.getApprovedUserId() == null ? other.getApprovedUserId() == null : this.getApprovedUserId().equals(other.getApprovedUserId()))
            && (this.getApprovedDate() == null ? other.getApprovedDate() == null : this.getApprovedDate().equals(other.getApprovedDate()))
            && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
            && (this.getOrganId() == null ? other.getOrganId() == null : this.getOrganId().equals(other.getOrganId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getNo() == null) ? 0 : getNo().hashCode());
        result = prime * result + ((getImageId() == null) ? 0 : getImageId().hashCode());
        result = prime * result + ((getExpandedDate() == null) ? 0 : getExpandedDate().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getRecipientInfo() == null) ? 0 : getRecipientInfo().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getSalesmanId() == null) ? 0 : getSalesmanId().hashCode());
        result = prime * result + ((getApprovedUserId() == null) ? 0 : getApprovedUserId().hashCode());
        result = prime * result + ((getApprovedDate() == null) ? 0 : getApprovedDate().hashCode());
        result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
        result = prime * result + ((getOrganId() == null) ? 0 : getOrganId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", amount=").append(amount);
        sb.append(", no=").append(no);
        sb.append(", remark=").append(remark);
        sb.append(", imageId=").append(imageId);
        sb.append(", expandedDate=").append(expandedDate);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", recipientInfo=").append(recipientInfo);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", deleted=").append(deleted);
        sb.append(", status=").append(status);
        sb.append(", salesmanId=").append(salesmanId);
        sb.append(", approvedUserId=").append(approvedUserId);
        sb.append(", approvedDate=").append(approvedDate);
        sb.append(", operatorId=").append(operatorId);
        sb.append(", organId=").append(organId);
        sb.append("]");
        return sb.toString();
    }
}